<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
    <style>
        body {
            background-color: #f1f1f1;
            font-family: Arial, sans-serif;
        }

        h2 {
            color: #333;
        }

        .container {
            max-width: 400px;
            margin: 0 auto;
            padding: 40px;
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            border-radius: 5px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #777;
        }

        .form-group input {
            display: block;
            width: 100%;
            padding: 8px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 3px;
        }

        .form-group input[type="submit"] {
            background-color: #4caf50;
            color: #fff;
            border: none;
            cursor: pointer;
        }

        .form-group input[type="submit"]:hover {
            background-color: #45a049;
        }

        .form-group p {
            color: #777;
            font-size: 14px;
        }

        .tabs {
            list-style: none;
            padding: 0;
            margin: 20px 0 0;
        }

        .tabs li {
            display: inline-block;
            margin-right: 10px;
        }

        .tabs li a {
            display: inline-block;
            padding: 10px 15px;
            background-color: #ddd;
            color: #333;
            text-decoration: none;
            border-radius: 3px;
        }

        .tabs li a.active {
            background-color: #4caf50;
            color: #fff;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>选择登录类型</h2>
        <ul class="tabs">
            <li class="active"><a href="#user-login">用户登录</a></li>
            <li><a href="#admin-login">管理员登录</a></li>
        </ul>

        <div class="tab-content">
            <div id="user-login" class="tab-panel" style="display: block;">
                <h2>用户登录</h2>
                <form action="" method="post">
                    <div class="form-group">
                        <label for="username">用户名：</label>
                        <input type="text" id="username" name="username" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码：</label>
                        <input type="password" id="password" name="password" required>
                    </div>
                    <input type="submit" value="登录">
                </form>
                <p>还没有账号？<a href="/user/register">点击这里注册</a></p>
            </div>

            <div id="admin-login" class="tab-panel" style="display: none;">
                <h2>管理员登录</h2>
                <form action="" method="post">
                    <div class="form-group">
                        <label for="adminUsername">管理员用户名：</label>
                        <input type="text" id="adminUsername" name="adminUsername" required>
                    </div>
                    <div class="form-group">
                        <label for="adminPassword">管理员密码：</label>
                        <input type="password" id="adminPassword" name="adminPassword" required>
                    </div>
                    <input type="submit" value="登录">
                </form>
            </div>
        </div>
    </div>

    <script>
        const tabs = document.querySelectorAll('.tabs li');
        const tabContent = document.querySelectorAll('.tab-content > div');

        tabs.forEach((tab, index) => {
            tab.addEventListener('click', () => {
                tabs.forEach((tab) => tab.classList.remove('active'));
                tab.classList.add('active');

                tabContent.forEach((content) => content.style.display = 'none');
                tabContent[index].style.display = 'block';
            });
        });
    </script>
</body>
</html>
